d/rules: use pkg-info.mk and do Maintainer parsing in d/rules
authorMaximilian Engelhardt <maxi@daemonizer.de>
Thu, 26 Jan 2023 21:06:50 +0000 (22:06 +0100)
committerHans van Kranenburg <hans@knorrie.org>
Wed, 1 Feb 2023 23:13:49 +0000 (00:13 +0100)
Use DEB_VERSION and DEB_VERSION_UPSTREAM from
/usr/share/dpkg/pkg-info.mk as suggested by lintian. This fixes
'debian-rules-parses-dpkg-parsechangelog' in the lintian output.

Also move parsing of the Maintainer field in debian/control from our
delta queue to debian/rules and use the newly available DEB_VERSION in
the delta queue.

Signed-off-by: Maximilian Engelhardt <maxi@daemonizer.de>
debian/rules

index dd94e3d4dbd13bc19091df57f64cb5d8d1469965..30460849782021c6d051d401ca81068f4dd48c36 100755 (executable)
@@ -5,10 +5,12 @@
 
 SHELL    := bash -e
 
-# SOURCE_BASE_DIR is used by our delta queue to find the top directory.  It
-# seems this information is currenty not directly provided by the Debian build
-# system.
-export SOURCE_BASE_DIR=$(shell pwd)
+# This gives us DEB_VERSION_UPSTREAM and DEB_VERSION (used by our delta queue)
+include /usr/share/dpkg/pkg-info.mk
+export DEB_VERSION
+
+# DEB_MAINTAINER is used by our delta queue
+export DEB_MAINTAINER := $(shell sed -ne 's/^Maintainer: \(.*\)$$/\1/p' debian/control)
 
 # This influences dpkg-buildflags to specify better linker
 # options.  See https://wiki.debian.org/Hardening
@@ -68,7 +70,7 @@ flavour=$(flavour_$(DEB_HOST_ARCH))
 # (Everywhere else, it is handled dynamically.)
 #
 upstream_version := \
- $(shell dpkg-parsechangelog -SVersion | sed 's/\(\.[0-9]*\)\..*/\1/' )
+ $(shell echo $(DEB_VERSION_UPSTREAM) | sed 's/\(\.[0-9]*\)\..*/\1/' )
 
 # Many of the debhelper files are most conveniently provided as
 # templates which depend on the flavour and the upstream version.